﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ITAP.ShprossesBuilder.Manipulation.PopupMenu
{
    public class PopupMenuProvider
    {
        private Dictionary<Type, ModelPopupMenu> menus;

        public PopupMenuProvider()
        {
            menus = new Dictionary<Type, ModelPopupMenu>();
        }

        public void RegisterPopupMenu(Type typeOfComponent, ModelPopupMenu popupMenu)
        {
            menus.Add(typeOfComponent, popupMenu);
        }

        public ModelPopupMenu GetMenu(Type typeOfComponent)
        {
            ModelPopupMenu menu;
            menus.TryGetValue(typeOfComponent, out menu);
            return menu;
        }
    }
}
